/*
 * @Author: moonwater 13812995013@163.com
 * @Date: 2025-02-28 17:17:29
 * @LastEditors: moonwater 13812995013@163.com
 * @LastEditTime: 2025-03-10 10:30:57
 * @FilePath: \盐师22Git仓库\day05\Test09.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package day05;

public class Test09 {
    public static void main(String[] args) {
        System.out.println("----------------------商场库存清单--------------------");
        System.out.println("品牌型号         尺寸     价格           ");
        String[] type={"MacBookAir","ThinkPad490","MateBook 14"};
        double[] sizes={13.3,14.0,14.0};
        double[] price={5699.0,8499.0,7199};
        int[] number = {5,10,18};
        for (int i = 0; i < number.length; i++) {
            System.out.printf("%-12s   %-6.1f   %-7.1f   %-7d   %n", type[i], sizes[i], price[i],number[i]);

        }
        System.out.println("------------------------------------------------------");

        //表格尾部
        int totalNumber = 0;
        double totalPrice = 0;
        for(int j = 0;j<number.length;j++){
            totalNumber += number[j];
            totalPrice += price[j]*number[j];
        }
        System.out.println("总库存数：" +totalNumber);
        System.out.println("商品总库存金额：" +totalPrice);
    }
    
}
